package Login_GUI;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class connectionMySQL {

	Connection con;
	
	public connectionMySQL() {
		String userName = "root";
		String password = "silvan13101985";
		String dbName = "Y_Ching";
		
		try{
			con = DriverManager.getConnection("jdbc:mysql://localhost", userName, password);
			con.setCatalog(dbName);
		}
		catch(Exception e) {
			System.out.println(e.toString());
		}
	}
	
	public void close() {
		try {
			con.close();
		}
		catch(SQLException e) {
			System.out.println(e.toString()); // ???
		}
		
	}
	
	//public boolean insertNewUser(User us) {
		//boolean b = false;
		//try {
	//		Statement s = con.createStatement();
			//String 
		//}
	//}
	
}
